﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace VietApps.TouristManagement
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }
        public void closeForm()
        {
            foreach (Form AppFormItem in this.MdiChildren)
            {
                AppFormItem.Dispose();
            }
            this.Text = "";
            // nap thong tin san pham
        }

        public void openForm(Form frmToShow)
        {
            this.Text = frmToShow.Text;
            frmToShow.MdiParent = this;
            frmToShow.StartPosition = FormStartPosition.CenterScreen;
            frmToShow.Show();
        }
        private void frmMain_Load(object sender, EventArgs e)
        {
            frmDangNhap _frm = new frmDangNhap();
            this.openForm(_frm);
        }

        private void mniExit_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void btnMain_Click(object sender, EventArgs e)
        {
            this.closeForm();
            frmDSHopDong _frm = new frmDSHopDong();
            this.openForm(_frm);
        }

        private void buttonItem1_Click(object sender, EventArgs e)
        {
            this.closeForm();
            frmDoiMatKhau _frm = new frmDoiMatKhau();
            this.openForm(_frm);
        }

        private void buttonItem3_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }

        private void buttonX1_Click(object sender, EventArgs e)
        {
            this.closeForm();
            frmRolePerms _frm = new frmRolePerms();
            this.openForm(_frm);
        }

        private void buttonX3_Click(object sender, EventArgs e)
        {
            this.closeForm();
            frmRoles _frm = new frmRoles();
            this.openForm(_frm);
        }

        private void buttonX5_Click(object sender, EventArgs e)
        {
            this.closeForm();
            frmDSHopDong _frm = new frmDSHopDong();
            this.openForm(_frm);
        }

        private void buttonX6_Click(object sender, EventArgs e)
        {
            this.closeForm();
            frmKhachHang _frm = new frmKhachHang();
            this.openForm(_frm);
        }

        private void buttonX4_Click(object sender, EventArgs e)
        {
            this.closeForm();
            frmNhanVien _frm = new frmNhanVien();
            this.openForm(_frm);
        }

        private void buttonX8_Click(object sender, EventArgs e)
        {
            this.closeForm();
            frmHoaDon _frm = new frmHoaDon();
            this.openForm(_frm);
        }
    }
}
